<?php

namespace App\Http\Controllers\Home;

use App\Model\UserLocation;
use Illuminate\Http\Request;

class LocationController extends BaseController
{
    public function store(Request $request)
    {
        $data = $request->all();
        $m = new UserLocation();
        $m->fill($data);
        $m->user_id = $this->loginUser()?$this->loginUser()->id:0;
        $m->save();
        return $this->success($m);
    }

    public function show($id)
    {
        $item = UserLocation::find($id);
        return $this->success($item);
    }
}
